/**
 * @author Javen 
 * @copyright 2018-09-22 17:29:34 javendev@126.com 
 * @description 控件节点Z轴
 */

cc.Class({
    extends: cc.Component,
    properties: {
        zIndex: {
            type: cc.Integer,
            default: 0,
            //使用notify函数监听属性变化
            notify(oldValue) {
                if (oldValue === this.zIndex) {
                    return;
                }
                this.node.zIndex = this.zIndex;
            }
        }
    },
    onLoad() {
        this.node.zIndex = this.zIndex;
    }
});